home *** CD-ROM | disk | FTP | other *** search
/ Learn Microsoft Visual Basic 6.0 Now / Learn Microsoft Visual Basic 6.0 Now (Microsoft Press)(X03-58607)(1998).ISO / media / chap08 / b08a010.cc2 < prev    next >
Text File  |  1998-06-07  |  2KB  |  39 lines

  1. 0, Drag-and-drop support is a simple 
  2. 2, feature to add to your Visual Basic 
  3. 3, applications. Before you create the effect, you'll 
  4. 7, need to add a source object to your 
  5. 8, form that you can drag and a target object 
  6. 12, that you can drop objects on. In this 
  7. 15, step-by-step example, we'll use a paper 
  8. 17, image for the source object and a trash 
  9. 20, can image for the target object. In Step 
  10. 24, 1, you enable the source object for drag 
  11. 27, and drop by setting its DragMode 
  12. 29, property to 1. This action unhooks the source 
  13. 33, object from its stationary position and 
  14. 36, allows the user to drag it when the 
  15. 37, program runs. In Step 2, you specify the icon 
  16. 43, that will appear when the user drags 
  17. 44, the source object. By default, Visual 
  18. 47, Basic uses a rectangle to represent the 
  19. 50, object being dragged. But, you can specify a 
  20. 53, custom icon by setting the DragIcon 
  21. 55, property. Try to use an icon that visually 
  22. 60, describes what the drag-and-drop 
  23. 61, operation will be accomplishing. In Step 3, you 
  24. 67, write a DragDrop event procedure for 
  25. 68, the target object. Visual Basic 
  26. 71, automatically executes the target object's 
  27. 73, DragDrop event procedure whenever a source 
  28. 76, object is dropped on a target object during 
  29. 79, the program. This is the place where you 
  30. 81, run any commands associated with the 
  31. 83, user's action. For example, if the user is 
  32. 87, dragging a scrap text file onto the 
  33. 90, trash can, you might remove the source 
  34. 92, image from the screen, replace the empty 
  35. 95, trash can with a burning trash can, and 
  36. 98, delete the associated file. By following 
  37. 101, these three fundamental steps, you can add 
  38. 104, drag-and-drop support to any program.
  39. 106, END